<script setup lang="ts">
import { ref } from 'vue'

const flag = ref(false)
</script>

<template>
  <button @click="flag = !flag">按钮</button>
  <XtxMessage v-if="flag" type="error">错错错</XtxMessage>
</template>

<style scoped></style>
